
/*    This file is part of the managarm operating system.
 *   Copyright (C) 2007, 2008, 2009  Alexander van der Grinten
 *
 *   This program is free software: you can redistribute it and/or modify
 *   it under the terms of the GNU General Public License as published by
 *   the Free Software Foundation, either version 3 of the License, or
 *   (at your option) any later version.
 *
 *   This program is distributed in the hope that it will be useful,
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *   GNU General Public License for more details.
 *
 *   You should have received a copy of the GNU General Public License
 *   along with this program.  If not, see <http://www.gnu.org/licenses/>. */

package ast;

import java.util.LinkedList;
import java.util.Iterator;

import org.managarm.jmanacclib.frontend.korona.KorAstNode;

public class AstClass extends KorAstNode {
	public static final int MOD_STATIC = 1;
	public static final int MOD_STRUCT = 2;
	public static final int MOD_FINAL = 4;
	
	// identifier, unit and parent of the class
	private final String identifier;
	private final String path;
	private final AstTerm parent;
	private final AstSpace container;
	private final int modifiers;
	
	// imports of this class
	private final LinkedList<AstTerm> imports;
	
	public AstClass(String identifier, int modifiers, String path,
			AstSpace container, AstTerm parent,
			LinkedList<AstTerm> imports, int line) {
		super(line);
		
		// set identifier, unit and parent
		this.modifiers = modifiers;
		this.identifier = identifier;
		this.parent = parent;
		this.imports = imports;
		this.path = path;
		this.container = container;
	}
	
	// varios getter methods
	public int getModifiers() { return modifiers; }
	public String getIdentifier() { return identifier; }
	public String getPath() { return path; }
	public AstTerm getParent() { return parent; }
	
	public Iterator<AstTerm> importIter() {
		return imports.iterator();
	}
	
	public AstSpace getContainer() {
		return container;
	}
}
